<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>geometricProgression</title>
</head>

<body>
    <div>打开浏览器控制台查看结果</div>
    <script>
        const geometricProgression = (end, start = 1, step = 2) =>
            Array.from({
                length: Math.floor(Math.log(end / start) / Math.log(step)) + 1
            }).map((_, i) => start * step ** i);
        console.log(geometricProgression(256));
        console.log(geometricProgression(256, 3));
        console.log(geometricProgression(256, 1, 4));
    </script>
</body>

</html>